package com.hp.goods_service.controller;

import com.hp.common_api.entity.SpecParam;
import com.hp.goods_service.service.ISpecParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SpecParamController {

    @Autowired
    private ISpecParamService specParamService;

    @GetMapping("/specParams/category/{cid}")
    public ResponseEntity<List<SpecParam>> getSpecParamsByCategoryId(@PathVariable Long cid){
        List<SpecParam> list = specParamService.getSpecParamsByCategoryId(cid);
        return ResponseEntity.ok(list);
    }
}
